2005-12-21 Matthias Clasen <mclasen@redhat.com>
+ * gdk/gdkregion-generic.c: Use the slice allocator
+ for regions. Still todo: avoid extra allocations for
+ the single-rectangle case.
+
* gtk/gtksettings.c (gtk_settings_class_init): Update
class_n_properties after installing color-hash, since
other classes install settings, too.
2005-12-21 Matthias Clasen <mclasen@redhat.com>
+ * gdk/gdkregion-generic.c: Use the slice allocator
+ for regions. Still todo: avoid extra allocations for
+ the single-rectangle case.
+
* gtk/gtksettings.c (gtk_settings_class_init): Update
class_n_properties after installing color-hash, since
other classes install settings, too.
{
GdkRegion *temp;
- temp = g_new (GdkRegion, 1);
+ temp = g_slice_new (GdkRegion);
temp->rects = g_new (GdkRegionBox, 1);
temp->numRects = 0;
if (rectangle->width <= 0 || rectangle->height <= 0)
return gdk_region_new();
- temp = g_new (GdkRegion, 1);
+ temp = g_slice_new (GdkRegion);
temp->rects = g_new (GdkRegionBox, 1);
temp->numRects = 1;
g_return_val_if_fail (region != NULL, NULL);
- temp = g_new (GdkRegion, 1);
+ temp = g_slice_new (GdkRegion);
temp->rects = g_new (GdkRegionBox, region->numRects);
temp->numRects = region->numRects;
g_return_if_fail (r != NULL);
g_free (r->rects);
- g_free (r);
+ g_slice_free (GdkRegion, r);
}